package hy.mvpdemo.presenter.impl;

import java.util.List;

import hy.mvpdemo.model.NewsDataModelInterface;
import hy.mvpdemo.model.RequestResultListener;
import hy.mvpdemo.model.bean.NewsBean;
import hy.mvpdemo.model.impl.NewsDataModelInterfaceImpl;
import hy.mvpdemo.presenter.NewsDataPresenterInterface;
import hy.mvpdemo.view.NewsView;

/**
 * Created by hy on 2016/10/23.
 */

public class NewsDataPresenterImpl implements NewsDataPresenterInterface,RequestResultListener<NewsBean>{



    private NewsView newsView;
    private NewsDataModelInterface newsDataModelInterface;



    public NewsDataPresenterImpl(NewsView newsView) {
        this.newsView = newsView;
        newsDataModelInterface=new NewsDataModelInterfaceImpl(this);

    }

    @Override
    public void loadDataofModel() {
        newsDataModelInterface.getNewsData();
    }





    @Override
    public void success(List<NewsBean> result) {
        newsView.LoadListDataforView(result);
    }

    @Override
    public void fail(String failresult) {

    }
}
